package practice;

//import java.util.Arrays;
import java.util.Scanner;

public class practice10 {
	public static void main(String[] args)
    {
		 Scanner scanner=new Scanner(System.in);
	        String str=scanner.nextLine();
	        String strs[]=str.split("，");
	        //System.out.println(Arrays.toString(strs));
	        int year=Integer.parseInt(strs[0].substring(2));
	        int month=Integer.parseInt(strs[1].substring(1));
	        int day=Integer.parseInt(strs[2].substring(1));
	        
	        
	        int year1[]={31,28,31,30,31,30,31,31,30,31,30,31};
	        int year2[]={31,29,31,30,31,30,31,31,30,31,30,31};
	        if (year %4 == 0 && year % 100 != 0 || year % 400 == 0)
	        {
	            int days=0;
	            for (int i=1;i<month;i++)
	            {
	                days=days+year2[i];
	            }
	            days=days+day;
	            System.out.format("%d年(闰年)%d月%d日为当年的第%d天",year,month,day,days);
	        }
	        else
	        {
	            int days=0;
	            for (int i=1;i<month;i++)
	            {
	                days=days+year1[i];
	            }
	            days=days+day;
	            System.out.format("%d年(平年)%d月%d日为当年的第%d天",year,month,day,days);
	        }
    }
}
//示例：年：2022，月3，日1
//输出：2022年(平年)3月1日为当年的第60天
